package r6.powtorka;

public class MaksMinMultiArg {

	public static void main(String[] args) {

		System.out.println(Maks(1, 2, 3, 4, -2, 7, 11));
		System.out.println(Min(1, 2, 3, 4, -2, 7, 11));
	}

	private static int Min(int... values) {
		int min = values[0];
		for(int i = 1; i < values.length; i++)
			if(values[i] < min)
				min = values[i];
		return min;
	}

	private static int Maks(int... values) {
		int max = values[0];
		for (int i = 1; i < values.length; i++)
			if (values[i] > max)
				max = values[i];
		return max;
	}

}
